from flask import request, render_template, redirect, session, jsonify
import json
from . import lab
from iaas import vmmgmt

@lab.route('/create_lab1', methods=['POST'])
def create_lab1(*args, **kwargs):
    body = request.data
    params = json.loads(body)

    print body, params

    vmmgmt.create_vm()

    lab1 = {"user": params["user"], "name": "lab1", "url": "http://test"}

    return json.dumps(lab1)
